$(function() {
	General.extendDialog();
	$('.input-daterange').datepicker({autoclose:true});
	//
	$("a[data-id='delete']").click(function(e){
		e.preventDefault();
		var url=$(this).data('url');
		var msg='是否真的要删除';
		var title='真的吗？';
		var okFun=function(data){
			var data={};
			if(url!=''){
				window.location.href=url;
			}
		};
		var cancelFun=function(){};
		var data=url;
		General.confirm(msg, title, okFun, cancelFun, data);
		//
		//General.stopEvent(e);
	});

	$("#import").click(function(){
		
		var title =  '导入订单';
		var url = '/yiyuan/admin/order/importOrders'
		showImportDialog(title,url);
	});
	/**
	 * 显示"导入"窗口
	 * @param {String} title 弹出窗口的标题
	 */
	function showImportDialog(title,url){
		General.showDialogWidthHeight(title,url,500,300);
	}
	//导出
	$('#purview').on('click', function(e) {
		General.stopEvent(e);
		var accountLimitUrl=$(this).data('url');
		General.showDialogWidthHeight('导出订单', accountLimitUrl, 500, 250);
	})

});